home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4444 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  899 b 

  1. Path: news.uni-jena.de!news
  2. From: mkt@isun04.inf.uni-jena.de (Tilo Koerbs)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Const Problem - Help Needed
  5. Date: 30 Jan 1996 12:39:24 GMT
  6. Organization: Lehrstuhl fuer Rechnerarchitektur- und kommunikation, FSU Jena
  7. Message-ID: <4el3hs$357@fsuj01.rz.uni-jena.de>
  8. References: <1995Oct11.021258.1736@news.wrc.xerox.com>
  9. Reply-To: mkt@isun04.inf.uni-jena.de
  10. NNTP-Posting-Host: isun15.inf.uni-jena.de
  11.  
  12. At first: your const member is not a const member!
  13. If it is changed by the server it is clearly a changeable,
  14. non const, member.
  15. Otherwise, you can let the server return a new struct,
  16. but I think it is passed via pointer or reference!
  17. The simplest solution is to cast the const away:
  18. const int i = 0;
  19. i = 1;  // error: i is const.
  20. (int&)i = 1;  // perfect!
  21.  
  22. But be sure that there is no other solution!
  23.  
  24. Send an e-Mail if this is not what you want, I try to help!
  25.  
  26.  
  27.  
  28.